import axios from '@/libs/request/axios'
import {getUri} from "@/libs/tools";
export function checkRule(rule,path) {
    return axios.request({
        url: `/${path}/voucherRule/checkRule`,
        method: 'post',
        data: rule
    });
}

export function saveRule(rule,path) {
    return axios.request({
        url: `/${path}/voucherRule/saveRule`,
        method: 'post',
        data: rule
    });
}

export function loadRuleDataById(id=-1,path='') {
    return axios.request({
        url: `/${path==''?getUri('rule'):path}/voucherRule/loadRuleTreeById/${id}`,
        method: 'post',
        data: {}
    });
}

export function saveRuleOut(rule,path) {
    return axios.request({
        url: `/${path}/voucherRule/saveRuleOut/`,
        method: 'post',
        data:rule
    });
}

